package com.xgq.drink.utils;

import java.util.concurrent.atomic.AtomicLong;

public class UniqueIdGenerator {

    private static final AtomicLong counter = new AtomicLong(0);

    /**
     * 生成一个独一无二的纯数字用户ID。
     * @return 生成的独一无二的纯数字用户ID。
     */
    public static synchronized long generateUniqueId() {
        long currentTimeMillis = System.currentTimeMillis();
        long uniqueId = currentTimeMillis * 1000 + counter.incrementAndGet();
        return uniqueId;
    }
}